package com.wicket.okrbff.web.contorller;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrbff.biz.service.dto.req.*;
import com.wicket.okrbff.biz.service.dto.res.*;
import com.wicket.okrbff.biz.service.PlanDataService;

import com.wicket.okrbff.common.ro.OkrResult;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
import com.wicket.okrapp.integration.FwAppPlanDataClient;
import com.wicket.okrframework.integration.FwBaseOrgClient;
import cn.hutool.core.collection.CollectionUtil;
import com.wicket.okrbff.common.exception.Assert;
import com.wicket.okrapp.integration.dto.QueryPlanDataDetailRespDto;
import com.wicket.okrapp.integration.dto.QueryPlanDataDetailReqDto;
import com.wicket.okrframework.integration.dto.QueryDeptDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryDeptDetailReqDto;
import com.wicket.okrbff.biz.service.dto.common.BffBusAppDocRelaDto;
import java.util.stream.Collectors;
import com.wicket.okrapp.integration.dto.QueryPlanDataListRespDto;
import com.wicket.okrapp.integration.dto.QueryPlanDataListReqDto;
import com.wicket.okrframework.integration.dto.BatchQueryDeptListRespDto;
import com.wicket.okrframework.integration.dto.BatchQueryDeptListReqDto;
import com.wicket.okrapp.integration.dto.QueryMidPlanDataListRespDto;
import com.wicket.okrapp.integration.dto.QueryMidPlanDataListReqDto;
import com.wicket.okrframework.integration.dto.QueryDeptDetailComBorderRespDto;
import com.wicket.okrframework.integration.dto.QueryDeptDetailComBorderReqDto;
import com.wicket.okrapp.integration.FwAppUnstructuredDataClient;
import com.wicket.okrapp.integration.dto.AddDocAndDocRelaComRespDto;
import com.wicket.okrapp.integration.dto.AddDocAndDocRelaComReqDto;
import com.wicket.okrapp.integration.dto.BusAppDocRelaDto;
import com.wicket.okrapp.integration.dto.AddAllTypePlanDataRespDto;
import com.wicket.okrapp.integration.dto.AddAllTypePlanDataReqDto;
import com.wicket.okrapp.integration.dto.DeletePlanDataRespDto;
import com.wicket.okrapp.integration.dto.DeletePlanDataReqDto;
import com.wicket.okrapp.integration.dto.RefreshCurrentPlanDataRespDto;
import com.wicket.okrapp.integration.dto.RefreshCurrentPlanDataReqDto;
import com.wicket.okrapp.integration.dto.ArchiveCurrentPlanDataRespDto;
import com.wicket.okrapp.integration.dto.ArchiveCurrentPlanDataReqDto;
import com.wicket.okrapp.integration.dto.UpdatePlanDataRespDto;
import com.wicket.okrapp.integration.dto.UpdatePlanDataReqDto;
import com.wicket.okrbff.biz.service.dto.common.BffPlanningDto;
import com.wicket.okrbff.biz.service.dto.common.BffPlanDataMgtDto;
import com.wicket.okrframework.integration.dto.QueryDeptSetDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryDeptSetDetailReqDto;
import com.wicket.okrcomponent.integration.FwCompUnstructuredDataClient;
import com.wicket.okrcomponent.integration.dto.ImplementLoopAddUnstructuredRelationshipComRespDto;
import com.wicket.okrcomponent.integration.dto.ImplementLoopAddUnstructuredRelationshipComReqDto;
import com.wicket.okrcomponent.integration.dto.UnstructuredRelationshipDto;
import com.wicket.okrbff.common.util.CommonFunctionHelper;
import com.wicket.okrapp.integration.dto.QueryPlanDataByPrimaryKeyDetailComRespDto;
import com.wicket.okrapp.integration.dto.QueryPlanDataByPrimaryKeyDetailComReqDto;
import com.wicket.okrapp.integration.dto.ImplementPerpareDataDocRelOrDocComRespDto;
import com.wicket.okrapp.integration.dto.ImplementPerpareDataDocRelOrDocComReqDto;
import com.wicket.okrcomponent.integration.dto.ImplementSeparateAddOrDeleteDocListComRespDto;
import com.wicket.okrcomponent.integration.dto.ImplementSeparateAddOrDeleteDocListComReqDto;
import com.wicket.okrapp.integration.dto.DocumentDto;
/**
 * @author ： 
 * @date ： 
 *
 *
 * @version 1.0
 */
@Api(value = "PlanData", tags = {"PlanData"})
@RestController
// @RequestMapping("/oms/planData/")
public class PlanDataController {
    @Autowired
    PlanDataService planDataService;
/**
   * B3-5查规划资料列表
   * gen by moon at 11/2/2022, 8:08:18 AM
   */
    @PostMapping("/oms/planData/queryPlanDataList")
    @ApiOperation(value = "B3-5查规划资料列表", response = OkrResult.class)
    public OkrResult<BffQueryPlanDataListRespDto> queryPlanDataList(@RequestBody(required=false) @Validated BffQueryPlanDataListReqDto reqDTO){
        return OkrResult.success(planDataService.queryPlanDataList(reqDTO));
    }
/**
   * B3-5查规划资料详情
   * gen by moon at 9/13/2022, 3:43:40 AM
   */
    @PostMapping("/oms/planData/queryPlanDataDetail")
    @ApiOperation(value = "B3-5查规划资料详情", response = OkrResult.class)
    public OkrResult<BffQueryPlanDataDetailRespDto> queryPlanDataDetail(@RequestBody(required=false) @Validated BffQueryPlanDataDetailReqDto reqDTO){
        return OkrResult.success(planDataService.queryPlanDataDetail(reqDTO));
    }
/**
   * B3-5查询中层规划资料列表
   * gen by moon at 10/23/2022, 2:36:46 PM
   */
    @PostMapping("/oms/planData/queryMidPlanDataList")
    @ApiOperation(value = "B3-5查询中层规划资料列表", response = OkrResult.class)
    public OkrResult<BffQueryMidPlanDataListRespDto> queryMidPlanDataList(@RequestBody(required=false) @Validated BffQueryMidPlanDataListReqDto reqDTO){
        return OkrResult.success(planDataService.queryMidPlanDataList(reqDTO));
    }
/**
   * B3-5查询管理模式规划资料列表(管理)
   * gen by moon at 11/2/2022, 8:08:30 AM
   */
    @PostMapping("/oms/mgt/planData/queryPlanDataMgtList")
    @ApiOperation(value = "B3-5查询管理模式规划资料列表(管理)", response = OkrResult.class)
    public OkrResult<BffQueryPlanDataMgtListRespDto> queryPlanDataMgtList(@RequestBody(required=false) @Validated BffQueryPlanDataMgtListReqDto reqDTO){
        return OkrResult.success(planDataService.queryPlanDataMgtList(reqDTO));
    }
/**
   * B3-5查询管理模式规划资料详情(管理)
   * gen by moon at 11/30/2022, 5:59:34 PM
   */
    @PostMapping("/oms/mgt/planData/queryPlanDataMgtDetail")
    @ApiOperation(value = "B3-5查询管理模式规划资料详情(管理)", response = OkrResult.class)
    public OkrResult<BffQueryPlanDataMgtDetailRespDto> queryPlanDataMgtDetail(@RequestBody(required=false) @Validated BffQueryPlanDataMgtDetailReqDto reqDTO){
        return OkrResult.success(planDataService.queryPlanDataMgtDetail(reqDTO));
    }
/**
   * B3-5新增规划资料(管理)
   * gen by moon at 11/10/2022, 11:50:13 PM
   */
    @PostMapping("/oms/mgt/planData/addPlanData")
    @ApiOperation(value = "B3-5新增规划资料(管理)", response = OkrResult.class)
    public OkrResult<BffAddPlanDataRespDto> addPlanData(@RequestBody(required=false) @Validated BffAddPlanDataReqDto reqDTO){
        return OkrResult.success(planDataService.addPlanData(reqDTO));
    }
/**
   * B3-5删除规划资料(管理)
   * gen by moon at 10/8/2022, 3:09:15 AM
   */
    @PostMapping("/oms/mgt/planData/deletePlanData")
    @ApiOperation(value = "B3-5删除规划资料(管理)", response = OkrResult.class)
    public OkrResult<BffDeletePlanDataRespDto> deletePlanData(@RequestBody(required=false) @Validated BffDeletePlanDataReqDto reqDTO){
        return OkrResult.success(planDataService.deletePlanData(reqDTO));
    }
/**
   * B3-新增规划资料文档关系
   * gen by moon at 11/11/2022, 5:42:37 AM
   */
    @PostMapping("/oms/planData/addBusAppDocRela")
    @ApiOperation(value = "B3-新增规划资料文档关系", response = OkrResult.class)
    public OkrResult<BffAddBusAppDocRelaRespDto> addBusAppDocRela(@RequestBody(required=false) @Validated BffAddBusAppDocRelaReqDto reqDTO){
        return OkrResult.success(planDataService.addBusAppDocRela(reqDTO));
    }
/**
   * B3更新当前规划资料(管理)
   * gen by moon at 10/8/2022, 3:10:40 AM
   */
    @PostMapping("/oms/mgt/planData/refreshCurrentPlanData")
    @ApiOperation(value = "B3更新当前规划资料(管理)", response = OkrResult.class)
    public OkrResult<BffRefreshCurrentPlanDataRespDto> refreshCurrentPlanData(@RequestBody(required=false) @Validated BffRefreshCurrentPlanDataReqDto reqDTO){
        return OkrResult.success(planDataService.refreshCurrentPlanData(reqDTO));
    }
/**
   * B3存档当前规划资料(管理)
   * gen by moon at 10/8/2022, 3:10:42 AM
   */
    @PostMapping("/oms/mgt/planData/archiveCurrentPlanData")
    @ApiOperation(value = "B3存档当前规划资料(管理)", response = OkrResult.class)
    public OkrResult<BffArchiveCurrentPlanDataRespDto> archiveCurrentPlanData(@RequestBody(required=false) @Validated BffArchiveCurrentPlanDataReqDto reqDTO){
        return OkrResult.success(planDataService.archiveCurrentPlanData(reqDTO));
    }
/**
   * B3-5修改规划资料(管理)
   * gen by moon at 10/8/2022, 3:09:17 AM
   */
    @PostMapping("/oms/mgt/planData/updatePlanData")
    @ApiOperation(value = "B3-5修改规划资料(管理)", response = OkrResult.class)
    public OkrResult<BffUpdatePlanDataRespDto> updatePlanData(@RequestBody(required=false) @Validated BffUpdatePlanDataReqDto reqDTO){
        return OkrResult.success(planDataService.updatePlanData(reqDTO));
    }
    
}

